-- [[ uncomment it to disable this module ]]--
do return end

g_Field = Proto("testField", "testFieldDescriptor")

print("Script testField")

-- define protocol fields
local f1_bool = ProtoField.new("testField.BOOLEAN", "BOOLEAN", ftypes.BOOLEAN)
local f2_bool = ProtoField.bool("testField.BOOLEAN", "BOOLEAN", base.NONE)--, base.HEX, {'True', 'False'}, 0xF0, 'blob?')
local f3_bool = ProtoField.bool("testField.BOOLEAN", "BOOLEAN", base.HEX, {'True', 'False'}, 0xF0, 'blob?')

local pf_bool = ProtoField.bool("testField.BOOLEAN", "BOOLEAN", base.NONE)
local pf_char = ProtoField.char("testField.CHAR", "CHAR")
local pf_int8 = ProtoField.int8("testField.INT8", "INT8")
local pf_int16 = ProtoField.int16("testField.INT16", "INT16")
local pf_int24 = ProtoField.int24("testField.INT24", "INT24")
local pf_int32 = ProtoField.int32("testField.INT32", "INT32")
local pf_int64 = ProtoField.int64("testField.INT64", "INT64")
local pf_uint8 = ProtoField.uint8("testField.UINT8", "UINT8")
local pf_uint16 = ProtoField.uint16("testField.UINT16", "UINT16")
local pf_uint24 = ProtoField.uint24("testField.UINT24", "UINT24")
local pf_uint32 = ProtoField.uint32("testField.UINT32", "UINT32")
local pf_uint64 = ProtoField.uint64("testField.UINT64", "UINT64")

local pf_float = ProtoField.float("testField.FLOAT", "FLOAT")
local pf_double = ProtoField.double("testField.DOUBLE", "DOUBLE")
local pf_string = ProtoField.string("testField.STRING", "STRING")
local pf_stringz = ProtoField.stringz("testField.STRINGZ", "STRINGZ")
local pf_bytes = ProtoField.bytes("testField.BYTES", "BYTES")

g_Field.fields = {
                pf_bool,  pf_char, 
                pf_int8,  pf_int16,  pf_int24,  pf_int32,   pf_int64,
                pf_uint8, pf_uint16, pf_uint24, pf_uint32,  pf_uint64, 
                pf_float,  pf_double, pf_string, pf_stringz, pf_bytes
                }

-- define dissector function (Tvb, Pinfo, TreeItem)
function g_Field.dissector(buf, pkt, tree)
    print('which one called me?', pkt.proto_name)
end

print("Script testField exit")
